package com.ityedao.自定义比较器Comparator;

import java.util.Arrays;

public class ComparableTest {
    public static void main(String[] args) {
        Student[] students = new Student[4];
        students[0] = new Student("小花", 18);
        students[1] = new Student("白月光", 45);
        students[2] = new Student("逆魔王", 28);
        students[3] = new Student("白骨精", 999);

        // Arrays类 sort 对数组进行排序
        Arrays.sort(students);
        System.out.println(Arrays.toString(students));
    }
}
